package com.wangijun.yuan.core.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 私信用户列表
 */
@Schema(description = "私信用户列表")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "chat_user")
public class ChatUser implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private Long id;

    /**
     * 发送用户ID
     */
    @TableField(value = "send_user_id")
    @Schema(description = "发送用户ID")
    private Long sendUserId;

    /**
     * 接收消息人ID
     */
    @TableField(value = "receive_user_id")
    @Schema(description = "接收消息人ID")
    private Long receiveUserId;

    /**
     * 最后一条消息内容
     */
    @TableField(value = "last_msg")
    @Schema(description = "最后一条消息内容")
    private String lastMsg;

    /**
     * 发送时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @Schema(description = "发送时间")
    private LocalDateTime createTime;

    /**
     * 最后交互时间
     */
    @TableField(value = "last_send_time")
    @Schema(description = "最后交互时间")
    private LocalDateTime lastSendTime;
    @Serial
    private static final long serialVersionUID = 1L;
}